﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace AppSocketModel
{
    /// <summary>
    /// 转发定位信息
    /// </summary>
    [BsonIgnoreExtraElements]
    public class RelayDto
    {
        /// <summary>
        /// ID
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        [BsonRepresentation(BsonType.ObjectId)]
        public string Id { get; set; }

        /// <summary>
        /// 公司Id
        /// </summary>
        public int CompanyId { set; get; }
        
        /// <summary>
        /// kafakaTopic
        /// </summary>
        public string Topic { set; get; }

        /// <summary>
        /// 设备IMEI
        /// </summary>
        public List<string> ImeiList { get; set; }

        /// <summary>
        /// 转发地址
        /// </summary>
        public string RelayUrl { get; set; }

        /// <summary>
        /// 端口号
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        /// 转发方式
        /// </summary>
        public  RelayType RelayType { get; set; }

        /// <summary>
        /// 启用
        /// </summary>
        public bool Enable { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { set; get; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime ModifyTime { set; get; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string ModifyAccountCode { set; get; }

        /// <summary>
        /// 转发服务运行状态
        /// </summary>
        public RelayServerRunState RelayServerRunState { set; get; }
         
        /// <summary>
        /// 转发服务控制命令执行状态
        /// </summary>
        public RelayControlCmdState RelayControlCmdState { set; get; }

        /// <summary>
        /// 错误消息提示信息
        /// </summary>
        public string LastErrorMessage { set; get; }

        /// <summary>
        /// 错误发生时间
        /// </summary>
        public DateTime LastErrorTime { set; get; }
    }
}
